package com.zx.练习题.demo;

import java.util.stream.Stream;

public class Demo7 {

    // 4.(java8)用stream+lambda将以下数组中的数字过滤出来，转换为Integer类型，并按照升序打印
    public static void main(String[] args) {
        String[] arr = {"abc", "3", "def", "211", "1", "-10", "0.5"};
        Stream.of(arr).filter(x -> x.matches("^[0-9_._-]*$")).map(Double::parseDouble).forEach(System.out::println);
    }
}
